package com.ai.fzqai.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.alibaba.cloud.ai.dashscope.api.DashScopeApi;

/**
 * @author yuluo
 * @author <a href="mailto:yuluo08290126@gmail.com">yuluo</a>
 */

@Configuration
public class BailianAutoconfiguration {

	/**
	 * 百炼调用时需要配置 DashScope API，对 dashScopeApi 强依赖。
	 * @return
	 */
	@Bean
	public DashScopeApi dashScopeApi(@Value("${spring.ai.dashscope.api-key}")  String key) {
		
		return DashScopeApi.builder().apiKey(key).build();
	}

	
//	@Bean
//	public DashScopeEmbeddingModel dashScopeEmbeddingModel(DashScopeApi dashScopeApi) {
//		
//		var embeddingModel = new DashScopeEmbeddingModel(dashScopeApi, MetadataMode.EMBED,
//		        DashScopeEmbeddingOptions.builder()
//		                .withModel("text-embedding-v2")
//		                .build());
//		return embeddingModel;
//	}
}

